package com.demo.core.verification;




import com.demo.core.annotation.NotEmpty;
import com.demo.core.utils.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
/**
 * @author Tan-Bowen
 * @description TODO 不能为空校验器
 * @date 2021/8/12 13:02
 */
public class NotEmptyValidator  implements ConstraintValidator<NotEmpty, String> {
    @Override
    public void initialize(NotEmpty constraintAnnotation) {

    }

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        return StringUtils.isNotEmpty(s);
    }
}
